package com.lvcoding.cloud.order.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author wuyanshen
 * @discription 订单控制器
 * @date 2020-07-13 2:39 下午
 */
@RestController
@RefreshScope
@RequestMapping("order")
public class OrderController {


    @Value("${version}")
    private String version;


    /**
     * 获取nacos中配置文件的参数
     * product-dev.yml
     */
    @GetMapping("nacos")
    public String test(){
        try {
            Thread.sleep(3000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return version;
    }

}
